package com.example.springcloud.service;

import com.example.springcloud.controller.DefaultProcess;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.MessageChannel;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@EnableBinding(DefaultProcess.class) //定义消息的推送管道
public class UserService {

    @Resource
    private MessageChannel study_output; // 消息的发送管道

    public String sendBrandAdd() {
        String serial = UUID.randomUUID().toString();
        this.study_output.send(MessageBuilder.withPayload(serial).build());
        System.out.println("*****sendBrandAdd: " + serial);
        return null;
    }
}
